package com.ruicar.afs.cloud.common.modules.dto.mq.loan.contractdto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.enums.AfsEnumDeserializer;
import com.ruicar.afs.cloud.common.core.enums.AfsEnumSerializer;
import com.ruicar.afs.cloud.common.modules.afscorebusiness.enums.InsuranceTypeEnum;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @param
 * @author yk.Li
 * @description 资产保险信息
 * @date 2020/7/8
 */
@Data
public class ContractInsuranceInfoDTO {
    /**
     * 合同号码
     */
    @JSONField(name = "contractNo")
    private String contractNo;
    /**
     * 车辆编号
     */
    @JSONField(name = "carId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long carId;
    /**
     * VIN码
     */
    @JSONField(name = "carVin")
    private String carVin;
    /**
     * 投保方式
     */
    @JSONField(name = "insuranceMode")
    private String insuranceMode;
    /**
     * 保险公司
     */
    @JSONField(name = "insuranceCompany")
    private String insuranceCompany;
    /**
     * 保单号
     */
    @JSONField(name = "insuranceNo")
    private String insuranceNo;
    /**
     * 保险类型 商业险，交强险
     */
    @JSONField(name = "insuranceType", serializeUsing = AfsEnumSerializer.class, deserializeUsing = AfsEnumDeserializer.class)
    private InsuranceTypeEnum insuranceType;
    /**
     * 保险金额
     */
    @JSONField(name = "insuranceAmt")
    private BigDecimal insuranceAmt;
    /**
     * 保险开始日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "insuranceStartTime")
    private Date insuranceStartTime;
    /**
     * 保险结束日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "insuranceEndTime")
    private Date insuranceEndTime;
}
